/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package eproject2;

import java.util.regex.Pattern;
import javax.swing.JTextField;

/**
 *
 * @author Hoang
 */
public class Function {

    static boolean isblank(JTextField txtfield) {
        return txtfield.getText().trim().isEmpty();
    }

    static boolean isphone(String phonenumber) {
        String phonepattern = "[0-9]{9,12}";
        return phonenumber.matches(phonepattern);
    }

    static boolean isnamme(String name) {
        String namepattern = "[a-zA-Z .]+";
        return name.matches(namepattern);
    }
    static boolean isemail(String email){
        String emailpattern="^[\\w_\\-%\\.]+@[\\w_\\-%\\.]+\\.[a-zA-Z]{2,6}$";
        return email.matches(emailpattern);
    }
    static boolean isurl(String homepage){
        String pattern="http://(www).[wd]+.[a-z]{2;3}";
        return true;
    }
}
